<?php namespace Home\Controller; 
use Hdphp\Controller\Controller;

//阅读全文控制器
class ContentController extends Controller{
    //首页
    public function index(){
    	$aid=Q('get.aid',0,'intval');
		//获取文章数据
		$arcModel=new \Common\Model\Arc;
		$data=$arcModel->join('article_data','aid','=','article_aid')->where("aid={$aid}")->find();
		//文章数据添加标签
		$arcTagModel=new \Common\Model\ArcTag;
		$data['tag']=$arcTagModel
					->join('tag','tag_tid','=','tid')
					->where("article_aid={$aid}")
					->get();
		//点击次数加1 
		$arcModel->where("aid={$aid}")->increment('click',1);
		View::with('data',$data);
    	View::make();
	}
}
?>
